package com.dly.hope.modle;

import com.dly.hope.type.FileType;
import lombok.Data;
import lombok.experimental.Accessors;
import org.hibernate.annotations.Comment;
import org.hibernate.annotations.DynamicInsert;
import org.hibernate.annotations.DynamicUpdate;
import org.hibernate.annotations.GenericGenerator;

import javax.persistence.*;

/**
 * @author linyu.dai
 * @project myserve
 * @description 文件存储表
 * @creat 2022/8/27 18:57:40
 */
@Entity
@Table(name = "hope002_file_info")
@DynamicUpdate
@DynamicInsert

@Data
public class FileInfo extends BaseEntity{

    @Id
    @Column(name = "id")
    @GeneratedValue(generator = "uuid")
    @GenericGenerator(name = "uuid", strategy = "org.hibernate.id.UUIDGenerator")
    private String id;

    @Column(name = "file_type")
    @Comment(value = "文件类型")
    private String fileType;

    @Column(name = "file_name")
    @Comment(value = "导出时的文件名字")
    private String name;

    @Column(name = "file_path")
    @Comment(value = "文件存储路径")
    private String path;

    @Column(name = "file_size")
    @Comment(value = "文件大小")
    private String size;

    @Column(name = "file_class")
    @Comment(value = "文件分类")
    @Enumerated(EnumType.STRING)
    private FileType fileClass;
}
